Add unit-test CI for PRs and main, with flaky-test hardening#91
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a CI workflow that builds and runs the unit tests on every push and on pull requests targeting
main, and hardens the test suite against a timing-sensitive flaky failure so CI stays reliably green/red for the right reasons.Changes
CI workflow (
.github/workflows/assembly.yml)push(all branches) andpull_requesttargetingmain, so PRs get validated before merge.permissions: contents: read.concurrencygroup keyed ongithub.refwithcancel-in-progress: trueso superseded runs on a branch/PR are cancelled.setup-javaand build with./gradlew build --stacktracefor clearer failure diagnostics.dorny/test-reporter@v3(native Node.js 24 runtime).fail-on-error: trueso the published check turns red when any test fails instead of masking failures.Flaky test mitigation
The robot battle tests are timing-sensitive and can intermittently report transient engine errors (e.g.
Unable to stop thread) on slow/loaded CI machines. Addressed on two complementary fronts:RobotThreadManager): make robot thread shutdown tolerant of CPU starvation rather than assuming a stuck thread. Extract the magic timeouts into named constants, give the shutdown path a larger overall budget, re-assert the interrupt periodically (a single early interrupt can be missed before the thread reaches an interruptible point), andThread.yield()while polling so a contended target thread gets scheduled.test-retryplugin (CI safety net): retry failed tests a couple of times via a shared convention so genuine flakiness does not fail the build, while real failures (all retries exhausted) still fail. Wired throughgradle/libs.versions.toml,buildSrc, and thejava-conventionsconvention plugin (gradlePluginPortal()added for plugin resolution).Notes
test-retryonly masks eventually-passing flakes; a test that fails all retries still fails the build and the test-reporter check.